#!/usr/bin/perl

require "./mailadmin-lib.pl";
&ReadParse();

my ($dname, $password, $err_msg);

$dname = $in{'dname'};
$password = $in{'passwd'};

$mailsize = $in{'mailsize'} * 1000 * 1024;
$mboxsize = $in{'mboxsize'} * 1000 * 1024;

unless ($dname)
{
    $err_msg = $text{'msg_dname_empty'};
    goto ERROR_OUT;
}

`postconf -e mydomain=$dname`;
`postconf -e message_size_limit=$mailsize`;
`postconf -e mailbox_size_limit=$mboxsize`;
`postfix reload`;

#$err_msg = &create_domain($dname, $password);
if ($err_msg)
{
    goto ERROR_OUT;
}

&redirect("config_domain.cgi");

 ERROR_OUT:;
my (@headp, @footp);
@headp = ($text{'error'}, "");
@footp = ("list_domain.cgi", $text{'back_lsdomain'});
&mail_error(\@headp, \@footp, $text{'err_title_save_create_domain'}, $err_msg);
